package vip.xiaonuo.modular.attendanceshift;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import vip.xiaonuo.modular.attendanceshift.entity.AttendanceShift;

@Data
public class AttendanceShiftOptionVo {

    private Long key;

    private String value;


    public AttendanceShiftOptionVo(Long key, String value) {
        this.key = key;
        this.value = value;
    }

    public AttendanceShiftOptionVo(AttendanceShift shift) {
        this.key = shift.getId();
        String shiftName = StringUtils.isEmpty(shift.getShiftShortName()) ? shift.getShiftName() : shift.getShiftShortName();
        this.value = shiftName + "[" +shift.getWorkTime()+"-"+shift.getOffWorkTime() +"]";
    }
}
